﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using BluSteamClient.Model;

namespace BluSteamClient.ViewModel
{
    public class ProjectBrowserViewModel : System.ComponentModel.INotifyPropertyChanged
    {
        ObservableCollection<UploadedProject> projectList;
        UploadedProject selectedProject;

        public ProjectBrowserViewModel()
        {
            //populate some sample data
            projectList = new ObservableCollection<UploadedProject>()
        {
            new UploadedProject(){ProjectName="A big pony", AuthorName="The baaws", ProjectBiography="This project is about ponies.", ProjectDownloadPath="Pakistan"},
            new UploadedProject(){ProjectName="Monopoly", AuthorName="Mr.Monopoly", ProjectBiography="This is a game of monopoly", ProjectDownloadPath="server/monopoly.exe"}
        };
        }

        #region Properties

        public ObservableCollection<UploadedProject> ProjectList
        {
            get { return projectList; }
        }

        public UploadedProject SelectedProject
        {
            get { return selectedProject; }
            set
            {
                selectedProject = value;
                RaisePropertyChanged("SelectedProject");
            }
        }

        #endregion

        #region INotifyPropertyChanged Members

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        private void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
        }

        #endregion
    }
}
